package com.zhiyou.aifeng.view

import android.view.View
import android.widget.ImageView
import com.zhiyou.aifeng.smart_machine.R
import com.zhpan.bannerview.BaseBannerAdapter
import com.zhpan.bannerview.BaseViewHolder

class ImageGuideAdapter : BaseBannerAdapter<Int, BaseViewHolder<Int>>() {

    override fun onBind(
        holder: BaseViewHolder<Int>,
        data: Int,
        position: Int,
        pageSize: Int
    ) {
        holder.bindData(data, position, pageSize)
    }

    override fun createViewHolder(itemView: View, viewType: Int) =
        object : BaseViewHolder<Int>(itemView) {
            override fun bindData(data: Int, position: Int, pageSize: Int) {
                val ivImg = findView<ImageView>(R.id.item_guide)
                // Glide.with(ivImg.context).load(data).into(ivImg)
                ivImg.setImageResource(data)
            }
        }

    override fun getLayoutId(viewType: Int) = R.layout.item_guide_img

}